home *** CD-ROM | disk | FTP | other *** search
/ Interactive Quarterly / The Best of New Machine Publishing 1 - Disc 4: Interactive Quarterly.iso / pc / demos / az / cyberx.dxr / 00197_GESTION DISPAROS.ls < prev    next >
Encoding:
Text File  |  1996-10-06  |  2.7 KB  |  92 lines

  1. on dispara toca
  2.   global calibre, ener_robot, TabPotArmas, num_robot, hay_municion, cal_1, cal_2, cal_3, TabRobot, TabRobE, num_batalla
  3.   set Pos to the number of cast "NIV_00.PIC"
  4.   set hay_municion to 0
  5.   if calibre = 1 then
  6.     if cal_1 > 0 then
  7.       set hay_municion to 1
  8.       set cal_1 to cal_1 - 1
  9.       if cal_1 = 0 then
  10.         set niv_mun to 0
  11.       else
  12.         set niv_mun to integer((12 / (float(max_cal_1) / float(cal_1))) + 0.40000000000000002)
  13.       end if
  14.       set the castNum of sprite 30 to Pos + niv_mun
  15.     end if
  16.   else
  17.     if calibre = 2 then
  18.       if cal_2 > 0 then
  19.         set hay_municion to 1
  20.         set cal_2 to cal_2 - 1
  21.         if cal_2 = 0 then
  22.           set niv_mun to 0
  23.         else
  24.           set niv_mun to integer((12 / (float(max_cal_2) / float(cal_2))) + 0.40000000000000002)
  25.         end if
  26.         set the castNum of sprite 31 to Pos + niv_mun
  27.       end if
  28.     else
  29.       if calibre = 3 then
  30.         if cal_3 > 0 then
  31.           set hay_municion to 1
  32.           set cal_3 to cal_3 - 1
  33.           if cal_3 = 0 then
  34.             set niv_mun to 0
  35.           else
  36.             set niv_mun to integer((12 / (float(max_cal_3) / float(cal_3))) + 0.40000000000000002)
  37.           end if
  38.           set the castNum of sprite 32 to Pos + niv_mun
  39.         end if
  40.       end if
  41.     end if
  42.   end if
  43.   if hay_municion then
  44.     if toca then
  45.       set ener_robot to ener_robot - getAt(TabPotArmas, calibre)
  46.       if ener_robot <= 0 then
  47.         sound stop 2
  48.         puppetSound("muerterob")
  49.         set the locH of sprite 3 to the mouseH
  50.         set the locV of sprite 3 to the mouseV
  51.         set tipo1 to "big1"
  52.         set tipo2 to "big2"
  53.         set tipo3 to "big3"
  54.         set the castNum of sprite 3 to cast tipo1
  55.         updateStage()
  56.         espera(10)
  57.         set the castNum of sprite 3 to cast tipo2
  58.         updateStage()
  59.         espera(10)
  60.         set the castNum of sprite 3 to cast tipo3
  61.         updateStage()
  62.         espera(60)
  63.         set the castNum of sprite 3 to cast tipo2
  64.         updateStage()
  65.         espera(5)
  66.         set the castNum of sprite 3 to cast tipo1
  67.         updateStage()
  68.         espera(5)
  69.         set the visible of sprite 3 to 0
  70.         updateStage()
  71.         espera(5)
  72.         repeat while soundBusy(1)
  73.         end repeat
  74.         deleteAt(TabRobot, num_robot)
  75.         deleteAt(TabRobE, num_robot)
  76.         set ticks_busca to the ticks + 30
  77.         set the visible of sprite 3 to 1
  78.         go("control" & num_batalla)
  79.       else
  80.         puppetSound("tocado" & calibre)
  81.         set the locH of sprite (3 + calibre) to the mouseH
  82.         set the locV of sprite (3 + calibre) to the mouseV
  83.         set the visible of sprite (3 + calibre) to 1
  84.         updateStage()
  85.       end if
  86.     else
  87.       puppetSound("disparo" & calibre)
  88.     end if
  89.   else
  90.   end if
  91. end
  92.